{% extends 'base.html' %}
{% block css-content %}
    <link rel="stylesheet" href="/static/jquery-confirm/jquery-confirm.min.css">
    <link href="/static/datatable/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">	
	<link href="/static/datatable/datatables.net-buttons-bs/css/buttons.bootstrap.min.css" rel="stylesheet">
	<link href="/static/datatable/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css" rel="stylesheet">
	<link href="/static/datatable/datatables.net-responsive-bs/css/responsive.bootstrap.min.css" rel="stylesheet">
	<link href="/static/datatable/datatables.net-scroller-bs/css/scroller.bootstrap.min.css" rel="stylesheet"> 
	<link href="/static/datatable/datatables.net-select/css/select.dataTables.min.css" rel="stylesheet">
	<link href="/static/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
    <link rel="stylesheet" href="/static/css/bootstrap-select.css">  
    <link rel="stylesheet" href="/static/tooltips/css/tooltips.css">    
	<style type="text/css"> 
		.pt {
			font-family: "微软雅黑","Microsoft Yahei",Arial,Helvetica,sans-serif,"宋体";
		    font-size: 13px;
			color: #515151;
		}	
		pre {
			overflow: auto;
			white-space: normal;
			white-space: pre-wrap; /* css-3 */
			white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
			white-space: -pre-wrap; /* Opera 4-6 */
			white-space: -o-pre-wrap; /* Opera 7 */
			word-wrap: break-word; /* Internet Explorer 5.5+ */
			font-family: Consolas, monospace;
			color: #ADFF2F;
			background-color: #000000;
		}	
		td.details-control {
		    background: url('/static/images/details_open.png') no-repeat center center; */
		    cursor: pointer;
		}
		tr.shown td.details-control {
		    background: url('/static/images/details_close.png') no-repeat center center;
		} 
		#project_local_command {
			width: 100%;
			height: 300px;
	   }   		      	
	</style>  
{% endblock %}
{% block page-content %}
        <div class="clearfix"></div> 
        
		<div class="row">
		
              <div class="col-md-12 col-sm-12 col-xs-12" id="noticeConfigDiv" style="display:none;">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>通知配置 <small>Orders Config</small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                      </li>
                      <li><a class="close-link"><i class="fa fa-close"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                  	<!--<div class="" role="tabpanel" data-example-id="togglable-tabs"  id="add_inventory" style="display:none;">-->
                    <div class="" role="tabpanel" data-example-id="togglable-tabs"  id="add_inventory">
                      <ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#tab_content1" id="#database" role="tab" data-toggle="tab" aria-expanded="true"><i class="fa fa-bell"></i> 通知方式</a>
                        </li>
<!--                         <li role="presentation" class=""><a href="#tab_content2" role="tab" id="#Inception" data-toggle="tab" aria-expanded="false"><i class="fa fa-cloud-upload"></i> 文件分发</a>
                        </li> 
                        <li role="presentation" class=""><a href="#tab_content3" role="tab" id="#CustomSql" data-toggle="tab" aria-expanded="false"><i class="fa fa-cloud-download"></i> 文件下载</a>
                        </li>   --> 
<!--                         <li role="presentation" class=""><a href="#tab_content4" role="tab" id="#allot" data-toggle="tab" aria-expanded="false"><i class="fa fa-cogs"></i> DB分配</a>
                        </li>  -->                                                                      
                      </ul>
                      <div id="myTabContent" class="tab-content">
                        <div role="tabpanel" class="tab-pane fade active in" id="tab_content1" aria-labelledby="#database">
							<div class="col-md-5 col-xs-12">
								<legend>
									<i class="fa  fa-paper-plane"></i> 工单类型配置
								</legend>
								<form role="form" method="post" id="order_config" class="main form-horizontal"  novalidate>
										{% csrf_token %}	
										<div class="item form-group" >
											 <label class="col-sm-2 control-label" >工单类型<span class="required">*</span></label>
											 <div class="col-sm-10">
												<select class="selectpicker form-control" id="order_type"  name="order_type" required>
													<option name="db_env" value="" selected="selected">选择一个类型</option>
													<option  value="0">SQL审核</option>
													<option  value="1">运维服务</option>
													<option  value="2">文件上传</option>
													<option  value="3">文件下载</option>
												</select>
											 </div>						 	
										</div>									
										<div class="item form-group" >
											 <label class="col-sm-2 control-label" >通知类型<span class="required">*</span></label>
											 <div class="col-sm-10">
												<select class="selectpicker form-control" id="mode"  name="mode" required>
													<option name="db_env" value="" selected="selected">选择一个类型</option>
													<option  value="0">邮箱</option>
													<option  value="1">微信</option>
													<option  value="2">钉钉</option>
												</select>
											 </div>						 	
										</div>											
<!-- 										<div class="item form-group" >
											 <label class="col-sm-2 control-label" >授权组<span class="required">*</span></label>
											 <div class="col-sm-10">
												<select class="selectpicker form-control"  name="grant_group" id="grant_group" required>
													<option  value="" selected="selected">选择一个授权组</option>
												</select>
											 </div>						 	
										</div> -->									
<!-- 										<div class="item form-group">
											<label class="col-sm-2 control-label" >通知对象<span class="required">*</span></label>
											<div class="col-sm-10">
												<textarea class="form-control" rows="3" name="number" placeholder="分号隔开" id="number" required></textarea>		
											</div>					
										</div>	 -->													
										<legend></legend>																											
										<div class="form-group">
											<label class="col-sm-4 control-label"></label> 								
											<button type="reset" class="btn btn-default btn-group-sm">取消</button>
											<button type="button" class="btn btn-default btn-group-sm" value="" name="noticeonfig">添加</button>
								 		</div>											
								</form>
							</div>
							<div class="col-md-7 col-xs-12">
								<legend>
									<i class="fa  fa-paper-plane-o"></i> 配置列表
								</legend>							
								<table  width="100%" class="table table-striped table-bordered" id="configList">						
		                                <thead>
												<tr>													
													<th class="text-center">
														<label>
															<span class="lbl"></span>
														</label>
														ID
													</th>
													<th class="text-center">工单类型</th>				
													<th class="text-center">通知类型</th>
													<!-- <th class="text-center">通知对象</th> -->
													<th class="text-center">操作</th>
												</tr>											    
		                                </thead>
		                                <tbody>
		                                </tbody>
		                       	</table>				
							</div>							
						</div>                                              
                    </div>                                  
                  </div>
                </div>
              </div>
        	</div> 		
		
            <div class="col-md-12 col-xs-12">
              <div class="x_panel">
                <div class="x_title">
                  <h2>工单列表<small>Order Lists</small></h2>
                  <ul class="nav navbar-right panel_toolbox">
                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                    </li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                    </li>
                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                    </li>
                  </ul>
                  <div class="clearfix"></div>
                </div>
                <div class="x_content">
                  	 <div class="row">
	                  	 <div class="col-sm-6">             
				             <p class="text-muted font-13 m-b-30">
				                 	工单组合查询
				             </p> 
				         </div>  	
		            </div>	
	                <div class="row">
				      <div class="col-md-2 col-sm-12 col-xs-12 form-group">
						 <select class="selectpicker form-control" id="selOrderType" title="工类类型">
							<option value="0">SQL更新</option>
							<option value="1">运维服务</option>
							<option value="2">文件分发</option>
							<option value="3">文件下载</option>						 						
						</select>
				      </div>	                

				      <div class="col-md-2 col-sm-12 col-xs-12 form-group">
						 <select class="selectpicker form-control" id="selExecute" title="工单执行进度">
							<option  value="0">已提交</option>
						    <option  value="1">处理中</option>
						    <option  value="2">已完成</option>
						    <option  value="3">已回滚</option>
						    <option  value="4">已关闭</option>
						    <option  value="5">已失败</option>						 
						</select>
				      </div>  
	
	
	                  <div class="col-md-2 col-sm-12 col-xs-12 form-group">
	                    	<select class="selectpicker form-control" id="selAudit" title="工单授权状态">	
							 	<option  value="1">已拒绝</option>
							 	<option  value="2">审核中</option>	    
							 	<option  value="3">已授权</option>	                  								
							</select>  
	                  </div>
	
	                  <div class="col-md-2 col-sm-12 col-xs-12 form-group">
					   <select  class="selectpicker form-control" id="selAuditUser" title="工单申请人">			   		
						</select>  				   									   							
	                  </div>
	                  
	                  <div class="col-md-2 col-sm-12 col-xs-12 form-group">
					   <select  class="selectpicker form-control" id="selExecuteUser" title="工单审核人">			   		
						</select>  				   									   							
	                  </div>	                  
	                  
				      <div class="col-md-2 col-sm-12 col-xs-12 form-group">
						 <select class="selectpicker form-control" id="selExpired" title="工单过期状态">						 	
						 	<option  value="0">已过期</option>
						 	<option  value="1">未过期</option>
						 	<option  value="2">未到期</option>
						</select>
				      </div>

				      <div class="col-md-2 col-sm-12 col-xs-12 form-group">
							<input type="text" name="order_time" placeholder="工单创建时间"  class="form-control" id="selOrderTime" value="" />	
				      </div>
				      	                  
	                  <div class="col-md-2 col-sm-12 col-xs-12 form-group  pull-right">
	                  	<div class="btn-group  btn-group-sm pull-right">
	                        <button class="btn btn-default" name="orders_page_previous" type="button" value="">上一页</button>
	                        <button class="btn btn-default" name="orders_page_next" type="button" value="">下一页</button>
	                        <input type="hidden" id="currentUser" name="custId" value="{{user.id}}">
	                    </div>
	                  </div>   	                  
	                </div>		                            
                    <div class="row">
                    	<div class="col-md-12 col-sm-12 col-xs-12 form-group">	
                    		<div class="product_price" id="divSelectedType" style="display:none;"></div> 
                    	</div>
                    	<div class="col-md-12 col-sm-12 col-xs-12 form-group">						           
		                    <table id="ordersLists" class="table table-hover">
		                      <thead>
		                        <tr>
		                        	<th class="text-center">详情</th>
					                <th>ID</th>
					                <th>工单类型</th>
					                <th>申请人</th>
					                <th>工单主题</th>
					                <th>操作人</th>
					                <th>申请时间</th>
					                <th>执行状态</th>
					                <th>审核状态</th>	
					                <th>过期状态</th>	
					                <th>过期时间</th>				                
									<th class="text-center">操作</th>
		                        </tr>
		                      </thead>
		                      <tbody>
		                      </tbody>
		                    </table>   
	                   </div>
                   </div>	       
                </div>
              </div>
            </div>
        </div>
              
        <div class="modal fade bs-example-modal-log" tabindex="-1" role="dialog" aria-hidden="true">
          <div class="modal-dialog modal-lg">
            <div class="modal-content">

              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="orderLogModalLabel"></h4>
              </div>
              <div class="modal-body">
                   <table id="ordersLogs" class="table table-hover">
                     <thead>
                       <tr>
                        <th>工单ID</th>
		                <th>操作人</th>
		                <th>备注</th>
		                <th>审核状态</th>
		                <th>进度状态</th>
		                <th>操作时间</th>				                
                       </tr>
                     </thead>
                     <tbody>
                     </tbody>
                   </table> 					
              </div>
              <div class="modal-footer">
                <!-- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> -->
              </div>

            </div>
          </div>
        </div>



           
           
                                 
{% endblock %}
{% block js-content %}
	<script src="/static/jquery-confirm/jquery-confirm.min.js"></script>
    <script src="/static/datatable/datatables.net/js/jquery.dataTables.min.js"></script>
	<script src="/static/datatable/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>	
    <script src="/static/datatable/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="/static/datatable/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
    <script src="/static/datatable/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="/static/datatable/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="/static/datatable/datatables.net-buttons/js/buttons.print.min.js"></script>   
    <script src="/static/tooltips/js/jquery.pure.tooltips.js"></script>	 
	<!-- bootstrap-daterangepicker -->
    <script src="/static/moment/min/moment.min.js"></script>
    <script src="/static/bootstrap-daterangepicker/daterangepicker.js"></script>      
    <script src="/static/js/orders/common.js"></script>
    <script src="/static/js/orders/list.js"></script>	
	<script src="/static/validator/validator.js"></script> 
{% endblock %}